package com.leiyuee.Lock;

/**
 * @Classname VolatileTest
 * @Description TODO
 * @Date 2022/7/12 10:17
 * @Created leiyu
 */
public class VolatileTest {

    int a =0;
    boolean flag = false;
    public void  write(){
        a =1;
        flag = true;
    }
    public void read (){
        if (flag){
            int i = a+a;
        }
    }
}
